﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using BLL;


namespace DAL
{
    public class StatusRepository : IStatusRepository
    {
        public List<BLL.StatusText> Search()
        {
                        
           
           // statusList =(from m in db.StatusTexts select m.StatusName).ToList();
            string searchSql = "select StatusName from StatusText";

            DataTable searchDataTable = DbHelperSql.ExecuteDataTable(searchSql);
            List<BLL.StatusText> statusList = new List<BLL.StatusText>();
            foreach (DataRow dr in searchDataTable.Rows)
            {
                StatusText statusText = new StatusText();
                statusText.StatusName = (string)dr["StatusName"];
                statusText.StatusId=(int)dr["StatusId"];

                statusList.Add(statusText);

            }
            
            return statusList;
        }
    }
}
